﻿@namespace Oqtane.Themes.Controls
@inherits ModuleActionsBase 
@attribute [OqtaneIgnore]

@if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, ModuleState.Permissions))
{
    <div class="app-moduleactions">
        <a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"></a>
        <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 37px, 0px);">
            @foreach (var action in Actions)
            {
                if (string.IsNullOrEmpty(action.Name))
                {
                    <div class="dropdown-divider"></div>
                }
                else
                {
                    <a class="dropdown-item" @onclick="(async () => await ModuleAction(action))">
                        @if (string.IsNullOrEmpty(action.Icon))
                        {
                            @((MarkupString) "&nbsp;&nbsp;");
                        }
                        else
                        {
                            <span class="oi oi-@action.Icon" aria-hidden="true"></span>
                        }
                        &nbsp;
                        @action.Name
                    </a>
                }
            }
        </div>
    </div>
}
